<?php
include("../../inc/conn.inc");
include("../islogin2.php");
    if($per_row["m_type"]=="3")
    {
        checkCount("job_post");
    }
if($_POST[act_tj]){
         $j_rs_1=mysql_query("select j_c_name from job_class where id='$_POST[job_class]'");
	     $j_row_1=mysql_fetch_array($j_rs_1);
	     $j_rs_2=mysql_query("select j_c_name from job_class where id='$_POST[job_smill]'");
	     $j_row_2=mysql_fetch_array($j_rs_2);
		 $job_class=($_POST[job_class])?$_POST[job_class]:0;
	     $job_smill=($_POST[job_smill])?$_POST[job_smill]:0;
		 $job_hy=explode("@",$_POST[job_hy]);

		 
		 
		$qw_rs=@mysql_query("select city_name from city where id='$_POST[c_provinces4]'");
		$qw_row=@mysql_fetch_array($qw_rs);
		$qw_rs2=@mysql_query("select city_name from city where id='$_POST[c_city4]'");
		$qw_row2=@mysql_fetch_array($qw_rs2);
		$qw_rs3=@mysql_query("select city_name from city where id='$_POST[c_diqu4]'");
		$qw_row3=@mysql_fetch_array($qw_rs3);
		
		$job_pro_id=$_POST[c_provinces4]?$_POST[c_provinces4]:0;
		$job_city_id=$_POST[c_city4]?$_POST[c_city4]:0;
		$job_dq_id=$_POST[c_diqu4]?$_POST[c_diqu4]:0;

@mysql_query("insert into job_post (member_id,job_title,job_nature,job_pro_id,job_pro,job_city_id,job_city,job_dq_id,job_dq,job_area,job_num,job_sex,job_effe,job_exp,job_edu,job_lan,job_salary,job_class_id,job_class_id2,job_class,job_class2,job_hy_id,job_hy,job_tel,job_email,job_describe,job_notes,job_addtime) values ('".$_COOKIE['user_id']."','$_POST[job_title]','$_POST[job_nature]','$job_pro_id','$qw_row[city_name]','$job_city_id','$qw_row2[city_name]','$job_dq_id','$qw_row3[city_name]','$_POST[job_area]','$_POST[job_num]','$_POST[job_sex]','$_POST[job_effe]','$_POST[job_exp]','$_POST[job_edu]','$_POST[job_lan]','$_POST[job_salary]','$job_class','$job_smill','$j_row_1[j_c_name]','$j_row_2[j_c_name]','$job_hy[0]','$job_hy[1]','$_POST[job_tel]','$_POST[job_email]','$_POST[job_describe]','$_POST[job_notes]','".date("Y-m-d H:i:s")."')");

echo "<script>location='index.php'</script>";
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心-三帝贸易网</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript" src="../js/left.js" charset="gb2312"></script>
<script type="text/javascript" src="/js/job_class.js" charset="gb2312"></script>
<script type="text/javascript" src="/js/city.js" charset="gb2312"></script>
<body>
<div id="mian">
<?php include("../inc/top.php");?>
<div class="top1"><span>您当前位置：<a href="../index.php" class="dh">会员助手</a> &gt;&gt; 招聘管理 &gt;&gt; 发布招聘职位</span></div>
<div class="left">
<?php include("../inc/left.php");?>
</div>
<div class="right">
<?php
 $m_rs=mysql_query("select m_tel,m_email,m_addre from member where id='".$_COOKIE['user_id']."'");
 $m_row=mysql_fetch_array($m_rs);
?>
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
   <TR>
     <TD height="40" bgcolor="#EFF6FF" style="font-size:18px;font-weight:bold;padding-left:8px;">发布招聘职位</TD>
   </TR>
</TABLE>
<br>
<TABLE width="100%" border="0" cellpadding="0" cellSpacing="1" bgcolor="#C1DCF5">
        <TBODY>
        <form method="post" action="" name="form1" onSubmit="return checkform()">
          <TR>
            <td width="17%" height="25" align="center" bgcolor="#EFF6FF">岗位名称<font color="#FF0000">*</font></td>
            <TD width="83%" bgcolor="#F9F9F9" style="padding-left:4px;"><input name="job_title" id="job_title" type="text" size="50" maxlength="200"></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">职位类别<font color="#FF0000">*</font></td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;line-height:35px;"><select name="job_class" id="job_class" onChange="changejobtype(document.form1.job_class.options[document.form1.job_class.selectedIndex].value)" style="width:190px;">
                              <option value="">选择、修改</option>
							  <?php
							     $rs=@mysql_query("select id,j_c_name from job_class  where j_c_id=0");
								 while($row=@mysql_fetch_array($rs)){
							  ?><option value="<?=$row['id']?>"><?=$row[j_c_name]?></option>
							  <?php }?>
                          </select>&nbsp;<select name="job_smill" id="job_smill" style="width:190px;">
                              <option value="">选择、修改</option>
						  </select></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">行业类别<font color="#FF0000">*</font></td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><select name="job_hy" id="job_hy" style="width:190px;">
                            <option value="">选择、修改</option>
							  <?php
							     $rs=@mysql_query("select id,job_hy_name from job_hy where job_hy_id=0");
								 while($row=@mysql_fetch_array($rs)){
							  ?><option value="<?=$row['id']?>@<?=$row[job_hy_name]?>"><?=$row[job_hy_name]?></option>
							  <?php }?>
                          </select></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">岗位性质</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><select name="job_nature" id="job_nature">
			   <option value="1">全职</option>
			   <option value="2">兼职</option>
			   <option value="3">实习</option>
			</select></TD>
          </TR>
		  <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">学历要求</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><select name="job_edu" id="job_edu">
              <option value="1" selected="selected">不限</option>
              <option value="2">高中</option>
              <option value="3">技校</option>
              <option value="4">中专</option>
              <option value="5">大专</option>
              <option value="6">本科</option>
              <option value="7">硕士</option>
              <option value="8">博士</option>
            </select></TD>
          </TR>
		  <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">工作经验</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;">
			<select name="job_exp" id="job_exp">
              <option value="1" selected="selected">不限</option>
              <option value="2">1年以下</option>
              <option value="3">1-2年</option>
              <option value="4">3-5年</option>
              <option value="5">6-7年</option>
              <option value="6">8-10年</option>
              <option value="7">10年以上</option>
            </select></TD>
          </TR> 
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">性别要求</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><select name="job_sex" id="job_sex">
            <OPTION value="1">不限</OPTION>
                <OPTION value="2">男</OPTION>
                <OPTION value="3">女</OPTION>
			</SELECT></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">招聘人数</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input name="job_num" type="text" id="job_num" value="若干" size="10" maxlength="50" onFocus="this.value=''">
            人</TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">有效日期</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><select name="job_effe" id="job_effe">
            <OPTION value="1">--长期有限--</OPTION>
                <OPTION value="2">3天</OPTION>
                <OPTION value="3">5天</OPTION>
				<OPTION value="4" selected="selected">7天</OPTION>
				<OPTION value="5">半个月</OPTION>
				<OPTION value="6">一个月</OPTION>
				<OPTION value="7">三个月</OPTION>
				<OPTION value="8">半年</OPTION>
				<OPTION value="9">一年</OPTION>
			</SELECT></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">语言能力</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input name="job_lan" id="job_lan" type="text" size="30" maxlength="50">&nbsp;例：英语-CET4</TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">薪金范围</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><SELECT name="job_salary" id="job_salary">
			  <OPTION value="1" selected>面谈</OPTION>
              <OPTION value="2">1000元/月以下</OPTION>
              <OPTION value="3">1000-2000元/月</OPTION>
              <OPTION value="4">2001-4000元/月</OPTION>
              <OPTION value="5">4001-6000元/月</OPTION>
              <OPTION value="6">6001-8000元/月</OPTION>
              <OPTION value="7">8001-10000元/月</OPTION>
              <OPTION value="8">10001-15000元/月</OPTION>
              <OPTION value="9">15000-25000元/月</OPTION>
              <OPTION value="10">25000元/月以上</OPTION>
            </SELECT></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">联系电话<font color="#FF0000">*</font></td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input name="job_tel" id="job_tel" type="text" size="20" maxlength="40" value="<?=$m_row[m_tel]?>"> 
              &nbsp;如：人事部电话</TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">招聘邮箱<font color="#FF0000">*</font></td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input name="job_email" id="job_email" type="text" size="35" maxlength="100" value="<?=$m_row[m_email]?>">
&nbsp;如：人事部E_mail</TD>
          </TR>
		  <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">工作城市<font color="#FF0000">*</font></td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;">
			<select  name="c_provinces4" id="c_provinces4" onChange="changecity4(document.form1.c_provinces4.options[document.form1.c_provinces4.selectedIndex].value)">
            <option value="">省份</option>
          <?php
          $result = mysql_query("select * from city where city_id=0");    
          while($res = mysql_fetch_array($result)){    
          ?>    
          <option value="<?=$res['id']?>"><?=$res['city_name']?></option> 
          <?php }?>   
       </select>
       <select name="c_city4" id="c_city4" onChange="changecity5(document.form1.c_city4.options[document.form1.c_city4.selectedIndex].value)">
            <option value="">城市</option>
       </select>
	   <select name="c_diqu4" id="c_diqu4">
            <option value="">地区</option>
       </select></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">工作地点<font color="#FF0000">*</font></td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input name="job_area" type="text" size="45" maxlength="100" value="<?=$m_row[m_addre]?>"></TD>
          </TR>
		  <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">职位描述<font color="#FF0000">*</font></td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><textarea name="job_describe" id="job_describe" cols="70" rows="20"></textarea></TD>
          </TR>
		  <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">注意事项</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><textarea name="job_notes" id="job_notes" cols="70" rows="4"></textarea></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">&nbsp;</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input type="submit" value="提交"><INPUT type="hidden" value="ok" name="act_tj" id="act_tj"></TD>
          </TR>
 </form>                
</TABLE>
</div>
<div class="onl"></div>
<?php include("../inc/foot.php");?>
</div>
</body>
</html>

<script language="javascript">
function $(id){
return document.getElementById(id);
}
function checkform(){
   if($("job_title").value==""){
      alert("岗位名称不能为空");
      $("job_title").focus();
      return false;
   }
   if($("job_class").value==""){
      alert("选择职位类别");
      $("job_class").focus();
      return false;
   }
   if($("job_smill").value==""){
      alert("选择职位类别");
      $("job_smill").focus();
      return false;
   }

   if($("job_hy").value==""){
      alert("选择行业类别");
      $("job_hy").focus();
      return false;
   }   
  
   if($("job_tel").value==""){
      alert("联系电话不能为空");
      $("job_tel").focus();
      return false;
   }
   if($("job_email").value==""){
      alert("邮箱不能为空");
      $("job_email").focus();
      return false;
   } 
 
   
   if($("c_provinces4").value==""){
      alert("请选择省份");
      $("c_provinces4").focus();
      return false;
   }
   
   if($("c_city4").value==""){
      alert("请选择城市");
      $("c_city4").focus();
      return false;
   }   
   
  if($("job_area").value==""){
      alert("工作地不能为空");
      $("job_area").focus();
      return false;
   }   
   
    if($("job_describe").value==""){
      alert("职位描述不能为空");
      $("job_describe").focus();
      return false;
   }   
}
</script>
